Skip to main content

Types of sound executation

Modes​

Immediate​

  • Freezes the game until the sound is fully loaded (larger sounds tend to have a longer loading time).

Best scenario to use​

  • Systems that need to reproduce sound repetitively and at high speed, the sound files are small and light, like 3 seconds, for example, shooting sound systems, car sounds, character damage sounds and small sound effects, or situations where the creation of new threads does not have negative effects on performance.

Disadvantages​

  • The sound file needs to be loaded in its entirety before starting to play, the game is frozen until it finishes loading, so if the sound file is large, generally longer than 5 seconds, it is expected that you will notice framedrops and stutters.

Ram memory consumption​

  • Light ram consumption, sound files are shared between sound players, if several sound players have the same project file, they will share the sound data, so ram memory consumption does not increase as new sound players are added.

Asynchronous​

  • Loads sound while the game is running.

Best scenario to use​

  • Systems that play heavy music or sound files, but you need the sound to start playing immediately. You don't need to worry about RAM consumption, or situations where creating new threads doesn't have negative effects on performance.

Disadvantages​

  • The sound file only starts playing after it is fully loaded, so for systems where the sound must start as soon as possible, asynchronous mode may not work as expected, it is loaded in the background using a new thread.

Ram memory consumption​

  • Light ram consumption, sound files are shared between sound players, if several sound players have the same project file, they will share the sound data, so ram memory consumption does not increase as new sound players are added.

Stream​

  • Starts playing sound immediately, even while charging.

Best scenario to use​

  • Systems that play heavy music or sound files, but it is not necessary to play the sound immediately. Any scenario where you will have many large sound files and you need to reduce RAM consumption, or situations where creating new threads does not have negative effects on performance.

Disadvantages​

  • Creates a new thread and consumes more RAM, so for systems where several sound players need to be instantiated, such as gunshot sounds, stream mode is not recommended

Ram memory consumption​

  • High memory consumption, it is not possible to share sound data between sound players, even if they are playing the same file. Memory consumption increases linearly for each sound player you place in the scene.